import axios from 'axios'

// 创建 axios 实例
const instance = axios.create({
    baseURL: 'http://127.0.0.1:3000',
    timeout: 10000,
  });

// 添加请求拦截器  
instance.interceptors.request.use(config => {
    // 在发送请求之前做些什么
    return config;
})
const get= (url,params)=>{
    return instance.get(url,{params})
}
const post= (url,params)=>{
    return instance.post(url,params)
}
const del= (url,params)=>{
    return instance.delete(url,params)
}
const put= (url,params)=>{
    return instance.put(url,params)
}
export {
    get,
    post,
    del,
    put
}